
<?php include './application/views/top.php'; ?>
<script src="/static/js/gsdai.js"></script>
<script src="/static/js/ajaxfileupload.js"></script>
<script src="/static/js/My97DatePicker/WdatePicker.js"></script>
<script src="/static/js/formCheck.js"></script>

<div class="clear"></div>
<div class="user_bottom all"></div>
<div class="clear h50"></div>
<div class="layout uc">
	<?php include './application/views/user/left.php'; ?>
	<?php
		$sex = $v['sex'];
		$cardType = $v['cardType'];
	?>
	<div class="right">
		<div class="menu_list"><?php include './application/views/user/menu.php'; ?></div>
		<?php if($type == 3){?>
        <div class="seach">
		<form id="collForm" action="/userborrow/coll.html" method="get">
			开始时间：<input class="input" type="text" id="strtime" name="strtime" style="width: 100px;" value="<?php echo $where['strtime'];?>"  onfocus="WdatePicker()" readonly/>
			结束时间：<input class="input" type="text" id="endtime" name="endtime" style="width: 100px;" value="<?php echo $where['endtime'];?>"  onfocus="WdatePicker()" readonly/>
			<a href="javascript:void(0)" onclick="document.getElementById('collForm').submit();" class="ann">查询</a>
			<a href="/userborrow/coll.html?act=excel&strtime=<?php echo $where['strtime'];?>&endtime=<?php echo $where['endtime'];?>"  class="ann">导出</a>
		</form>
        </div>
        <?php }?>
        <div class="cont">
        	<ul class="tbt">
            	<li class="w168">债权转让标题</li>
                <li class="w90">待还金额</li>
                <li class="w90">待还本金</li>
                <li class="w90">本金折让率</li>
                <li class="w90">折后金额</li>
                <li class="w150">添加时间</li>
                <li class="w80">状态</li>
                <li class="w80">说明</li>
                <li class="w80 npr">操作</li>
			</ul>
			<?php 
				$stsArr = array(1=>'正在申请',2=>'正在出售',3=>'已完成',4=>'已取消');
			?>
            <?php foreach ($list as $val){?>
        	<ul class="tbc">
            	<li class="w168"><?php echo $val['title'];?></li>
            	<li class="w90"><?php echo $val['wait_account'];?></li>
            	<li class="w90"><?php echo $val['account'];?></li>
            	<li class="w90"><?php echo $val['discount_apr'];?>%</li>
            	<li class="w90"><?php echo $val['discount_account'];?></li>
            	<li class="w150"><?php echo date('Y-m-d H:i',$val['add_time']);?></li>
            	<li class="w80"><?php echo $stsArr[$val['fstatus']];?></li>
            	<li class="w80" title="<?php echo $val['verify_remark'];?>"><?php echo utf8substr($val['verify_remark'],0,6);?></li>               
            	<li class="w80 npr">
					<?php if ($val['fstatus']==1){?>
					<a href="javascript:void(0);" class="zrbutton" onclick="cancel(<?php echo $val['id'];?>);">取消申请</a>
					<?php }else{?>
					--
					<?php }?>
                </li>
			</ul>
        	<?php }?>
        </div>
        <div class="clear h30"></div>
        <div class="page">
            <div class="pagination">
            <?php echo $this->pagination->create_links();?>
            </div>
        </div>
	</div>
</div>
<div class="clear h50"></div>
<?php include "./application/views/footer.php";?>
<script>
function cancel(id){
	$('#dialog').dialog({
		modal:true,
		title:'系统提示',
		buttons:{
			"确定":function(){
				$.ajax({
					type: "get",
					url: "/userborrow/applycancel.html?id="+id,
					success: function(msg){
						$('#dialog').dialog({
							modal:true,
							title:'系统提示',
							buttons:{"确定":function(){location='/userborrow/mycreditor.html'}}
						});
						$("#msg").html(msg);
					},
					dataType: "text"
				});
			},
			"取消":function(){
				$(this).dialog("close");
			}
		}
	});
	$("#msg").html('确认取消？');
}

</script>